/**
 * 
 */
package genealogy.deprecated.datamodel.pedigree.comparator;

import edu.byu.cs.dml.recordlinkage.stringmetrics.EnsembleCJMN;
import uk.ac.shef.wit.simmetrics.similaritymetrics.AbstractStringMetric;
import genealogy.deprecated.datamodel.pedigree.Location;

/**
 * @author Steve
 * @invariant 
 */
@Deprecated
public class LocationComparator {

	private AbstractStringMetric m_stringComparator = new EnsembleCJMN();
	
	public Double compareLocations(Location location1, Location location2) {
		if (location1 == null || location2 == null)
		{
			return null;
		}

		if (location1.toString().length() == 0 || location2.toString().length() == 0)
		{
			return null;
		}
		double score = (double) m_stringComparator.getSimilarity(location1.toString(), location2
				.toString());
		
		return score * score;
	}
	
}
